<?php $this->_extends('../_layouts/default_layout'); ?>
<?php $this->_block('contents'); ?>
<script type="text/javascript">
$(function(){
	$("#check_all").click(function(){
		if ($(this).is(":checked"))
		{
			$(".module input[type='checkbox']").attr("checked", true);
		}
		else
		{
			$(".module input[type='checkbox']").attr("checked", false);
		}
	});
});
</script>
<form method="post" action="<?=url('Online::EbayTemplate/TemplateEditSave()')?>">
<table class="form_table">
<tr>
	<th>所属基板</th>
	<td><?=$template['base_name']?></td>
	<th>模板路径</th>
	<td><?=$template['path']?></td>
</tr>
<tr>
	<th><label><input type="checkbox" id="check_all" /> 生成板块</label></th>
	<td class="module">
		<?foreach ($module as $k => $m):?>
		<strong>【<?=$k?>】</strong>
		<?foreach ($m as $v):?>
		<label><input type="checkbox" name="base_part_module_ids[<?=$v['id']?>]" value="<?=$v['id']?>" <?if (in_array($v['id'], $template['ebay_template_base_part_module_ids']))echo "checked='checked'"?>/> <?=$v['name']?></label>
		<?endforeach;?>
		<br />
		<?endforeach;?>
	</td>
</tr>
<tr>
	<th>所属店铺</th>
	<td>
		<select disabled="disabled">
			<?foreach ($shop as $s):?>
			<option value="<?=$s['id']?>" <?if ($template['shop_id'] == $s['id'])echo "selected='selected'"?>><?=$s['name']?></option>
			<?endforeach;?>
		</select>
	</td>
</tr>
<tr>
	<th>模板名称</th>
	<td><input type="text" name="name" value="<?=$template['name']?>" /></td>
</tr>
<tr>
	<th>模板样式</th>
	<td colspan='3'><textarea name="css" cols="80" rows="8"><?=$template['css']?></textarea></td>
</tr>
<tr>
	<th><input type="hidden" value="<?=$template['id']?>" name="id" /></th>
	<td><input type="submit" value="保存修改" class="button" /></td>
</tr>
</table>
</form>
<?php $this->_endblock();?>